// 喜欢/不喜欢 model

import { HTTP, api } from '../utils/http'

/**
 * 喜欢/不喜欢 model
 */
class LikeModel extends HTTP {

  /**
   * 喜欢
   * @param {*} behavior 喜欢/不喜欢
   * @param {*} artID 编号
   * @param {*} category 类型
   */
  like(behavior, artID, category) {
    const requestApi = behavior === 'like' ? api.like.like : api.like.cancel

    this.request({
      ...requestApi,
      data: {
        behavior: behavior,
        art_id: artID,
        type: category
      }
    })
  }

}

export { LikeModel }